// src/constants/colors.ts
export const StatusColors = {
  PROCESSING: '#3d6eeb',  // 处理中 - 蓝色
  SUCCESS: '#3cb46e',     // 成功 - 绿色
  WARNING: '#dada2a',     // 警告 - 黄色
  ERROR: '#ed2906',      // 错误 - 红色
  DEFAULT: '#9e9e9c',    // 默认 - 灰色
  CANCELED: '#f47608',   // 已取消 - 橙色
} as const;
// src/types/order.ts
type StatusCode = '1' | '2' | '3' | '4' | '11' | '99';

interface StatusConfig {
  text: React.ReactNode;
  color: string;
  status: 'processing' | 'success' | 'warning' | 'error' | 'default';
  icon?: React.ReactNode;
}

type OrderStatusEnum = Record<StatusCode, StatusConfig>;

// src/constants/orderStatus.ts
import { FormattedMessage } from '@umijs/max';
import { 
  ClockCircleOutlined, 
  CheckCircleOutlined, 
  ExclamationCircleOutlined,
  CloseCircleOutlined,
  StopOutlined,
  CheckOutlined 
} from '@ant-design/icons';

export const orderStatusEnum: OrderStatusEnum = {
  "1": {
    text: (
      <FormattedMessage
        id="pages.order.status.submitted"
        defaultMessage="已提交"
      />
    ),
    color: StatusColors.PROCESSING,
    status: "processing",
    icon: <ClockCircleOutlined />,
  },
  "2": {
    text: (
      <FormattedMessage
        id="pages.order.status.forecast"
        defaultMessage="预测中"
      />
    ),
    color: StatusColors.SUCCESS,
    status: "success",
    icon: <CheckCircleOutlined />,
  },
  "3": {
    text: (
      <FormattedMessage
        id="pages.order.status.cancelling"
        defaultMessage="取消中"
      />
    ),
    color: StatusColors.WARNING,
    status: "warning",
    icon: <ExclamationCircleOutlined />,
  },
  "4": {
    text: (
      <FormattedMessage
        id="pages.order.status.canceled"
        defaultMessage="已取消"
      />
    ),
    color: StatusColors.CANCELED,
    status: "default",
    icon: <CloseCircleOutlined />,
  },
  "5": {
    text: <FormattedMessage id="pages.log.status.pendingDelivery" />,
    color: StatusColors.PROCESSING,
    status: "default",
    icon: <ClockCircleOutlined />,
  },
  "6": {
    text: <FormattedMessage id="pages.log.status.inDelivery" />,
    color: StatusColors.PROCESSING,
    status: "default",
    icon: <ClockCircleOutlined />,
  },
  "7": {
    text: <FormattedMessage id="pages.log.status.delivered"/>,
    color: StatusColors.SUCCESS,
    status: "default",
    icon: <CheckOutlined />,
  },
  "11": {
    text: (
      <FormattedMessage
        id="pages.order.status.abnormal_forecast"
        defaultMessage="异常预测"
      />
    ),
    color: StatusColors.ERROR,
    status: "error",
    icon: <StopOutlined />,
  },
  "99": {
    text: (
      <FormattedMessage
        id="pages.order.status.obsolete"
        defaultMessage="已废弃"
      />
    ),
    color: StatusColors.DEFAULT,
    status: "default",
    icon: <StopOutlined />,
  },
} as const;